The present invention relates generally to techniques for updating software stored in electronic devices having non-volatile memory, and more particularly to fault-tolerant methods and systems supporting the processing of updates of firmware, software, configuration parameters and file systems in memory of an electronic device such as, for example, non-volatile flash-type memory.
Embedded electronic devices sometimes have file systems that are stored in flash-type non-volatile (“flash”) memory, such as EEPROMs. And these file systems are quite often configured as compressed read-only file systems for optimal use of the flash memory. The files, executables and other types of data, are generally decompressed and loaded into RAM for reference or execution by the host system. It can be very useful to periodically update the data in these stored file systems to, for example, upgrade current software for added functionality or to simply fix bugs in the software code. And such software upgrades or bug fixes are commonly sent over wireless connections or through wired-internet connections.
An original version of a file system is referred to herein as V1 (or version 1) and the updated version as V2 (or version 2). In some cases, much of V2 is similar or identical to V1. In this situation, an update may be done by sending just the information that has changed between V1 and V2. A tool that is referred to herein as a “generator” accepts V1 and V2 as inputs, and produces information used in the electronic device to convert or transform version V1 into version V2. This information may be stored in a file referred to herein as an update package (UP), which may be sent to all of the embedded electronic devices that are to be updated. Each of these electronic devices contains a program referred to herein as an “update agent,” which applies the UP to version V1, thus converting V1 to produce version V2.
The most direct type of software update is to create the new version of each changed flash block in a buffer (RAM), and then to write that data to its final location in non-volatile memory. Often times data in the updated version of a block of data depends on the data in its original version. This can cause a problem if the power dies while the updated data is being written in the non-volatile memory, since then the updated version in the buffer is gone, and the original data that is required to create the new data blocks may be corrupted. Once the device is corrupted, the user is often faced with the need to physically take the device to a service center where the memory can be erased and completely reimaged.
While the following discussion focuses primarily on mobile electronic devices such as, for example, mobile handsets, cellular phones, personal digital assistants (PDA), MP3 players, pagers, and handheld personal computers, this is by way of example and not by way of specific limitations. The teachings contained herein may also be applicable to a variety of other electronic devices having a processor and non-volatile memory containing software, firmware, configuration information, data files, and the like, for which updating of the memory contents may be desirable.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one skilled in the art, through comparison of such systems with a representative embodiment of the present invention as set forth in the remainder of the present application with reference to the drawings.